﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ucItemPropertiesBase.cs" company="SmartPlan">
//   SmartPlan 2011
// </copyright>
// <summary>
//   The uc item properties base.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DbDiff.WinClient.Forms.DbItems
{
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    /// <summary>
    /// The uc item properties base.
    /// </summary>
    public class UcItemPropertiesBase : UserControl
    {
        #region Constants

        /// <summary>
        /// The diff const
        /// </summary>
        protected const int DIFF = 4;

        /// <summary>
        /// The propertynameleft.
        /// </summary>
        protected const int PROPERTYNAMELEFT = 8;

        /// <summary>
        /// The propertytop.
        /// </summary>
        protected const int PROPERTYTOP = 8;

        /// <summary>
        /// The propertyvalueleft.
        /// </summary>
        protected const int PROPERTYVALUELEFT = 180;

        /// <summary>
        /// The propertyvaluewidth.
        /// </summary>
        protected const int PROPERTYVALUEWIDTH = 300;

        /// <summary>
        /// The propertyheight.
        /// </summary>
        protected const int PROPERTYHEIGHT = 14;

        /// <summary>
        /// The null.
        /// </summary>
        protected const string NULL = "NULL";

        /// <summary>
        /// The dbnull.
        /// </summary>
        protected const string DBNULL = "DBNULL";

        #endregion Constants

        #region Fields & properties

        /// <summary>
        /// The _title.
        /// </summary>
        protected string _title;

        /// <summary>
        /// The is update.
        /// </summary>
        protected bool isUpdate;

        #endregion Fields & properties

        #region Controls

        /// <summary>
        ///   Required designer variable.
        /// </summary>
        protected Container components;

        /// <summary>
        /// The lbl title.
        /// </summary>
        protected Label lblTitle;

        /// <summary>
        /// The panel main.
        /// </summary>
        protected Panel panelMain;

        #endregion Controls

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="UcItemPropertiesBase"/> class.
        /// </summary>
        public UcItemPropertiesBase()
        {
            // This call is required by the Windows.Forms Form Designer.
            this.InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
            this._title = string.Empty;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UcItemPropertiesBase"/> class.
        /// </summary>
        /// <param name="title">
        /// The title.
        /// </param>
        public UcItemPropertiesBase(string title)
        {
            // This call is required by the Windows.Forms Form Designer.
            this.InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
            this._title = title;
        }

        #endregion Constructors

        /// <summary>
        /// The set data.
        /// </summary>
        protected virtual void SetData()
        {
            this.UpdateView();
        }

        /// <summary>
        /// The update view.
        /// </summary>
        protected virtual void UpdateView()
        {
        }

        #region Component Designer generated code

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }

            base.Dispose(disposing);
        }

        /// <summary>
        /// Required method for Designer support - do not modify 
        ///   the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.panelMain = new Panel();
            this.lblTitle = new Label();
            this.SuspendLayout();

// panelMain
            this.panelMain.AutoScroll = true;
            this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panelMain.Location = new Point(0, 23);
            this.panelMain.Name = "panelMain";
            this.panelMain.Size = new Size(512, 353);
            this.panelMain.TabIndex = 0;

// lblTitle
            this.lblTitle.BackColor = System.Drawing.SystemColors.ActiveCaption;
            this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
            this.lblTitle.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.lblTitle.Location = new Point(0, 0);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(512, 23);
            this.lblTitle.TabIndex = 1;
            this.lblTitle.Text = "TITLE";
            this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

// UcItemProperties
            this.Controls.Add(this.panelMain);
            this.Controls.Add(this.lblTitle);
            this.Name = "UcItemProperties";
            this.Size = new Size(512, 376);
            this.ResumeLayout(false);
        }

        #endregion
    }
}